#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    priority_queue<int> pre;
    vector<int> qre;
    long long sum = 0;
    for (int i = 0; i < n; i++)
    {
        int q;
        cin >> q;
        sum += q;
        if (q % 2 == 0)
        {
            pre.push(q);
        }
        else
        {
            qre.push_back(q);
        }
    }
    int n1 = pre.size();
    while (n1 && k)
    {
        int p = pre.top();
        p /= 2;
        sum -= p;
        if (p % 2 != 0)
        {
            pre.pop();
            n1--;
        }
        else
        {
            pre.pop();
            pre.push(p);
        }
        k--;
    }
    cout << sum << endl;
    return 0;
}

int main() {
    int n, k;
    cin >> n >> k;
    priority_queue<int> pre;
    long long sum = 0;
    for (int i = 0; i < n; i++)
    {
        int q;
        cin >> q;
        sum += q;
        pre.push(q);
    }
    while (pre.size() && k)
    {
        int p = pre.top();
        pre.pop();
        if (p % 2 == 0)
        {
            p /= 2;
            sum -= p;
            if (p % 2 == 0)
            {
                pre.push(p);
            }
            k--;
        }
    }
    cout << sum << endl;
    return 0;
}

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> pre;
    vector<int> qre;
    for (int i = 0; i < n; i++)
    {
        int q;
        cin >> q;
        if (q % 2 == 0)
        {
            pre.push_back(q);
        }
        else
        {
            qre.push_back(q);
        }
    }
    sort(pre.begin(), pre.end());
    int n1 = pre.size();
    while (n1 && k)
    {
        int p = pre[n1 - 1];
        p /= 2;
        if (p % 2 != 0)
        {
            qre.push_back(p);
            pre.pop_back();
            n1--;
        }
        else
        {
            pre[n1 - 1] = p;
            sort(pre.begin(), pre.end());
        }
        k--;
    }
    long long sum = 0;
    for (auto s : pre)
    {
        sum += s;
    }
    for (auto s : qre)
    {
        sum += s;
    }
    cout << sum << endl;
    return 0;
}

int main() {
    string str;
    getline(cin, str);
    string s1 = "";
    int n = str.size();
    for (int i = 0; i < n;)
    {
        if (str[i] >= 'a' && str[i] <= 'z')
        {
            s1 += (str[i] - 32);
        }
        else
        {
            s1 += str[i];
        }
        while (i < n && str[i] != ' ')
        {
            i++;
        }
        i++;
    }
    cout << s1 << endl;
    return 0;
}

int main() {
    int a, b;
    cin >> a >> b;
    int arr[a];
    for (int i = 0; i < a; i++)
    {
        cin >> arr[i];
    }
    int l = INT_MAX;
    int left = 0;
    int right = 0;
    int my_left = 0;
    int my_right = 0;
    int sum = 0;
    while (right < a)
    {
        sum += arr[right];
        while (sum >= b)
        {
            if (l > right - left + 1)
            {
                l = right - left + 1;
                my_left = left + 1;
                my_right = right + 1;
            }
            sum -= arr[left];
            left++;
        }
        right++;
    }
    cout << my_left << " " << my_right << endl;
    return 0;
}